package area;

public class Cylinder {
    private double radius;
    private double height;
    private static final double PI = 3.14;
    //表面积
    public void squaring(){
        double squaring = 2 * PI * radius * radius + (2 * PI *radius) * height;
        System.out.println("该圆柱的表面积为："+squaring);
    }
    //体积
    public void cube(){
        double cube = PI * radius * radius * height;
        System.out.println("该圆柱的体积为："+cube);
    }
    public static void main(String[] args) {
        Cylinder c = new Cylinder();
        c.radius = 20;
        c.height = 20;
        c.squaring();
        c.cube();
    }
}
